package cn.shyouchi.wuguanjia.android.api.home;

import android.content.Context;

import cn.shyouchi.wuguanjia.android.api.ClientProvider;
import cn.shyouchi.wuguanjia.android.api.UserStorageProvider;
import cn.shyouchi.wuguanjia.android.components.storage.UserStorage;
import cn.shyouchi.wuguanjia.android.ui.home.security.thread.contact.ContactEntity;
import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by Eenie on 2016/12/30 at 11:08
 * Email: 472279981@qq.com
 * Des:
 */

public class HomeApi {

    private HomeService mService;

    private UserStorage mUserStorage;
    private Context mContext;

    public HomeApi(Context context) {
        mUserStorage =  UserStorageProvider.Default();
        mContext = context;
        Retrofit retrofit =  ClientProvider.getDefaultClient().getRetrofit();
        mService = retrofit.create(HomeService.class);
    }

    public Observable<ContactEntity> fetchContact() {
        return mService.fetchContact(mUserStorage.getToken());
    }



}
